package model.location;

import model.Coordinate;
import model.Dimension;

public abstract class Area 
{
	protected Coordinate _coordinate;
	protected Dimension _dimension;
	
	protected float[] _points;
	
	public Area(Coordinate coordinate, Dimension dimension)
	{
		_coordinate = coordinate;
		_dimension = dimension;
		
		setPoints();
	}
	
	public Area(Coordinate coordinate, Dimension dimension, boolean fromCenter)
	{
		//
	}

	public Coordinate getCoordinate() {
		return _coordinate;
	}

	public void setCoordinate(Coordinate coordinate) {
		_coordinate = coordinate;
	}

	public Dimension getDimension() {
		return _dimension;
	}

	public void setDimension(Dimension dimension) {
		_dimension = dimension;
	}
	
	public abstract Coordinate getCenterCoord();
	
	public float[] getPoints()
	{
		if(_points == null)
			setPoints();
		return _points;
	}
	
	public abstract void setPoints();
	
	@Override
	public String toString() 
	{
		return String.format("UpperLeft: %s - Center: %s\nDimension: %s", _coordinate.toString(), getCenterCoord().toString(), _dimension.toString());
	}
}
